package com.spic.business.ioc.service.impl;

import com.spic.business.ioc.domain.IocRainfall;
import com.spic.business.ioc.mapper.IocRainfallMapper;
import com.spic.business.ioc.service.IIocRainfallService;
import com.spic.common.core.utils.UUIDUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 年合计降雨量IOCService业务层处理
 *
 * @author spic
 * @date 2022-04-14
 */
@Service
public class IocRainfallServiceImpl implements IIocRainfallService
{
    @Autowired
    private IocRainfallMapper iocRainfallMapper;

    /**
     * 查询年合计降雨量IOC
     *
     * @param id 年合计降雨量IOC主键
     * @return 年合计降雨量IOC
     */
    @Override
    public IocRainfall selectIocRainfallById(String id)
    {
        return iocRainfallMapper.selectIocRainfallById(id);
    }

    /**
     * 查询年合计降雨量IOC列表
     *
     * @param iocRainfall 年合计降雨量IOC
     * @return 年合计降雨量IOC
     */
    @Override
    public List<IocRainfall> selectIocRainfallList(IocRainfall iocRainfall)
    {
        return iocRainfallMapper.selectIocRainfallList(iocRainfall);
    }

    /**
     * 新增年合计降雨量IOC
     *
     * @param iocRainfall 年合计降雨量IOC
     * @return 结果
     */
    @Override
    public int insertIocRainfall(IocRainfall iocRainfall)
    {
        String uuid = UUIDUtil.createUUID();
        iocRainfall.setId(uuid);
        return iocRainfallMapper.insertIocRainfall(iocRainfall);
    }

    /**
     * 修改年合计降雨量IOC
     *
     * @param iocRainfall 年合计降雨量IOC
     * @return 结果
     */
    @Override
    public int updateIocRainfall(IocRainfall iocRainfall)
    {
        return iocRainfallMapper.updateIocRainfall(iocRainfall);
    }

    /**
     * 批量删除年合计降雨量IOC
     *
     * @param ids 需要删除的年合计降雨量IOC主键
     * @return 结果
     */
    @Override
    public int deleteIocRainfallByIds(String[] ids)
    {
        return iocRainfallMapper.deleteIocRainfallByIds(ids);
    }

    /**
     * 删除年合计降雨量IOC信息
     *
     * @param id 年合计降雨量IOC主键
     * @return 结果
     */
    @Override
    public int deleteIocRainfallById(String id)
    {
        return iocRainfallMapper.deleteIocRainfallById(id);
    }

    /**
     * @return 年合计降雨量
     */
    @Override
    public List<Map<String, Object>> getyearRainfall()
    {
        return null;
    }
}
